package com.celan.year2023.month02.day04;

import java.util.Arrays;

public class Solution {
    public int getMaximumConsecutive(int[] coins) {
        int res = 1;
        Arrays.sort(coins);
        for (int coin : coins) {
            if (coin <= res) {
                res = res + coin;
            }
        }
        return res;
    }
}
